import Opt from '@/components/dt/info/Opt.js'

class LogColumn extends Opt {

  constructor() {
    super()
    this.build()
  }

  build() {
    this.createAll()
    this.opts.push(...this.all)
  }

  createAll() {
    this.all = [
      {
        field: 'createTime',
        title: '审核时间',
        minWidth: 170
      },
      {
        field: 'auditName',
        title: '审核人',
        minWidth: 130,
      },
      {
        field: 'auditState',
        title: '审核状态',
        minWidth: 90,
        cell: {
          text: {},
          value: (info) => {
            return info.auditState == 1 ? '通过' : '驳回'
          }
        }
      },
      {
        field: 'rebutReason',
        title: '审核内容',
        minWidth: 550,
        cell: {
          text: {
            whiteSpace: 'pre-wrap',
            tooltip: false
          }
        }
      },
      {
        title: '图片',
        minWidth: 130,
        cell: (item) => {
          return {
            btn: [{
              title: item.picUrlList && item.picUrlList.length > 0 ? `查看图片（${item.picUrlList.length}）` : '-',
              event: 'onImage',
            }]
          }
        }
      }
    ]
  }

}

export default LogColumn
